#include <QQmlContext>
#include "rtspcodecview.h"
#include "ui_rtspcodecview.h"
#include "rtspcodecwidget.h"

RtspCodecView::RtspCodecView(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::RtspCodecView)
{
    ui->setupUi(this);

    RtspCodecWidget *m_rtspCodecWidget = new RtspCodecWidget(this);
    m_rtspCodecWidget->open("rtsp://admin:abc12345@192.168.2.221:554/h264/ch1/main/av_stream");
    ui->quickWidget->rootContext()->setContextProperty("ExhibitionModel",m_rtspCodecWidget);
    ui->quickWidget->engine()->addImageProvider("CodeImg", m_rtspCodecWidget->imageProvider());
    ui->quickWidget->setSource(QUrl("qrc:///rtspcodec/qml/RtspCodecView.qml"));

}

RtspCodecView::~RtspCodecView()
{
    delete ui;
}
